echo "===>start build with 8 thread"
result=`ndk-build -C jni -j4`

remote_device=192.168.0.54

if [[ $# == 1 ]]
then
    remote_device=$1
fi

echo "===>build done, start install into $remote_device"

adb connect $remote_device

number=`adb devices | wc -l`
number=$((number-2))
#echo "===>adb device number $number"

adb -s $remote_device root
adb -s $remote_device remount
adb -s $remote_device push libs/armeabi-v7a/suface /system/bin/suface


echo "===>install done, restart it"
pid=`adb -s $remote_device shell ps | grep suface | busybox awk '{print $2}'`
adb -s $remote_device shell kill $pid
adb shell suface



#adb -s $remote_device pull /sdcard/pic .
